<%- partial('sidebar') %>

<div id='content'>
	<div class='panel'>
		<div class='header'>
			<ul class='breadcrumb'>
				<li><a href='/'>主页</a><span class='divider'>/</span></li>
				<li class='active'>设置</li>
			</ul>
		</div>
		<div class='inner'>
			<% if(locals.error){ %>
			<div class="alert alert-error">	
				<a class="close" data-dismiss="alert" href="#">&times;</a>
				<strong><%= error %></strong>
			</div>
			<% } %>
			<% if (locals.success) { %>
			<div class="alert alert-success">	
				<strong><%= success %></strong>
			</div>
			<% } %>
			<form id='setting_form' class='form-horizontal' action='/setting' method='post'>
				<div class='control-group'>
					<label class='control-label' for='name'>用户名</label>
					<div class='controls'>
						<input class='input-xlarge readonly' id='name' name='name' size='30' type='text' readonly='true' value="<%= name %>" />
					</div>
				</div>
				<div class='control-group'>
					<label class='control-label' for='email'>电子邮件</label>
					<div class='controls'>
						<input class='input-xlarge readonly' id='email' name='email' size='30' type='text' readonly='true' value="<%= email %>" />
					</div>
				</div>
				<div class='control-group'>
					<label class='control-label' for='profile_image_url'>头像URL</label>
					<div class='controls'>
						<input class='input-xlarge' id='profile_image_url' name='profile_image_url' type='text' value="<%= locals.profile_image_url || '' %>" />
					</div>
				</div>
				<div class='control-group'>
					<label class='control-label' for='url'>个人网站</label>
					<div class='controls'>
						<% if(locals.url){ %>
						<input class='input-xlarge' id='url' name='url' size='30' type='text' value="<%= url %>" />
						<% }else{ %>
						<input class='input-xlarge' id='url' name='url' size='30' type='text' value='' />
						<% } %>
					</div>
				</div>
				<div class='control-group'>
					<label class='control-label' for='location'>所在地点</label>
					<div class='controls'>
						<% if(locals.location){ %>
						<input class='input-xlarge' id='location' name='location' size='30' type='text' value="<%= location %>" />
						<% }else{ %>
						<input class='input-xlarge' id='location' name='location' size='30' type='text' value='' />
						<% } %>
					</div>
				</div>
				<div class='control-group'>
					<label class='control-label' for='signature'>个性签名</label>
					<div class='controls'>
						<% if(locals.signature){ %>
						<input class='input-xlarge' id='signature' name='signature' size='30' type='text' value="<%= signature %>" />
						<% }else{ %>
						<input class='input-xlarge' id='signature' name='signature' size='30' type='text' value='' />
						<% } %>
					</div>
				</div>
				<div class='control-group'>
					<label class='control-label' for='profile'>个人简介</label>
					<div class='controls'>
						<% if(locals.profile){ %>
						<textarea class='input-xlarge' id='profile' name='profile' rows='4'><%= profile %></textarea>
						<% }else{ %>
						<textarea class='input-xlarge' id='profile' name='profile' rows='4'></textarea>
						<% } %>
					</div>
				</div>
				<div class='control-group'>
					<label class='control-label' for='weibo'>微博</label>
					<div class='controls'>
						<% if(locals.weibo){ %>
						<input class='input-xlarge' id='weibo' name='weibo' size='30' type='text' value="<%= weibo %>" />
						<% }else{ %>
						<input class='input-xlarge' id='weibo' name='weibo' size='30' type='text' value='' />
						<% } %>
					</div>
				</div>
				<div class='control-group'>
					<label class='control-label' for='receive_at_msg'>邮件提醒</label>
					<div class='controls'>
						<label class='checkbox'>
							<% if(locals.receive_at_mail){ %>
							<input type='checkbox' name='receive_at_mail' checked='checked' />
							<% }else{ %>
							<input type='checkbox' name='receive_at_mail' />
							<% } %>
							我被别人@时
						</label>
						<label class='checkbox'>
							<% if (locals.receive_reply_mail){ %>
							<input type='checkbox' name='receive_reply_mail' checked='checked' />
							<% }else{ %>
							<input type='checkbox' name='receive_reply_mail' />
							<% } %>
							我的话题收到回复时
						</label>
					</div>
				</div>
				<input type='hidden' id='action' name='action' value='change_setting' />
				<input type='hidden' name='_csrf' value='<%= csrf %>' />
				<div class='form-actions'>
					<input type='submit' class='btn' value='保存设置' />
				</div>
			</form>
		</div>
	</div>	

	<div class='panel'>
		<div class='header'>	
			<span class='col_fade'>头像</span>
		</div>
		<div class='inner'>
			<p><%= config.name %> 使用<a href='http://en.wikipedia.org/wiki/Gravatar' target='_blank'> Globally Recognized Avata </a>，与您的 Email 关联，请在<a href='http://en.gravatar.com/' target='_blank'> Gravatar </a>注册或更改您的头像。</p>
			<p>您当前的头像如下：</p>
			<% if (locals.profile_image_url) { %>
			自定义: <img class="user_avatar" src="<%= locals.profile_image_url %>" />
			&nbsp;|&nbsp;
			<% } %>
			gravatar: <img class="user_avatar" src="<%= current_user.avatar %>" />
		</div>
	</div>

	<div class='panel'>
		<div class='header'>	
			<span class='col_fade'>更改密码</span>
		</div>
		<div class='inner'>
			<form id='change_pass_form' class='form-horizontal' action='/setting' method='post'>
				<div class='control-group'>
					<label class='control-label' for='old_pass'>当前密码</label>
					<div class='controls'>
						<input class='input-xlarge' type='password' id='old_pass' name='old_pass' size='30' />
					</div>
				</div>
				<div class='control-group'>
					<label class='control-label' for='new_pass'>新密码</label>
					<div class='controls'>
						<input class='input-xlarge' type='password' id='new_pass' name='new_pass' size='30' />
					</div>
				</div>
				<input type='hidden' id='action' name='action' value='change_password' />
				<input type='hidden' name='_csrf' value='<%= csrf %>' />
				<div class='form-actions'>
					<input type='submit' class='btn' value='更改密码' />
				</div>
			</form>
		</div>
	</div>
</div>
